load("@io_bazel_rules_go//go:def.bzl", "go_library")
load("//build:go_binary.bzl", "go_binary")

go_library(
    name = "go_default_library",
    srcs = ["main.go"],
    importpath = "github.com/jetstack/cert-manager/cmd/controller",
    visibility = ["//visibility:private"],
    deps = [
        "//cmd/controller/app:go_default_library",
        "//cmd/util:go_default_library",
        "//pkg/logs:go_default_library",
    ],
)

go_binary(
    name = "controller",
    embed = [":go_default_library"],
    visibility = ["//visibility:public"],
)

filegroup(
    name = "package-srcs",
    srcs = glob(["**"]),
    tags = ["automanaged"],
    visibility = ["//visibility:private"],
)

filegroup(
    name = "all-srcs",
    srcs = [
        ":package-srcs",
        "//cmd/controller/app:all-srcs",
    ],
    tags = ["automanaged"],
    visibility = ["//visibility:public"],
)
